package com.wanmait.baohan.service.Impl;

import com.github.pagehelper.PageInfo;
import com.wanmait.baohan.mapper.BookingAccountMapper;
import com.wanmait.baohan.pojo.BookingAccount;
import com.wanmait.baohan.service.BookingCountService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;
@Service
@Transactional(rollbackFor = Exception.class)
public class BookingCountServiceImpl implements BookingCountService {
    @Resource
    BookingAccountMapper bookingAccountMapper;

    @Override
    public void insert(BookingAccount object) {
        bookingAccountMapper.insert(object);
    }

    @Override
    public void delete(Integer id) {

    }

    @Override
    public void delete(String ids) {

    }

    @Override
    public void update(BookingAccount object) {

    }

    @Override
    public BookingAccount findById(Integer id) {
        return null;
    }

    @Override
    public List<BookingAccount> findAll() {
        return null;
    }

    @Override
    public List<BookingAccount> findAll(BookingAccount object) {
        return null;
    }

    @Override
    public PageInfo<BookingAccount> findPage(int pageNum) {
        return null;
    }

    @Override
    public PageInfo<BookingAccount> findPage() {
        return null;
    }

    @Override
    public PageInfo<BookingAccount> findPage(int pageNum, BookingAccount object) {
        return null;
    }

    @Override
    public PageInfo<BookingAccount> findPage(BookingAccount object) {
        return null;
    }

    @Override
    public List<BookingAccount> findAllByIdTicket(Integer id,Integer state) {
        return bookingAccountMapper.selectByAllTicket(id,state);
    }

    @Override
    public void updateByAccount(Integer userId,Integer trvalId) {
        bookingAccountMapper.updateByAccount(userId,trvalId);
    }

    //通过id获取一个申请的所有订票
    @Override
    public List<BookingAccount> findBookingListById(Integer id) {
        List<BookingAccount> list=bookingAccountMapper.findBookingListById(id);
        return list;
    }

    @Override
    public Integer findAllCost(Integer applicationId) {
        return bookingAccountMapper.selectAllCost(applicationId);
    }
}
